package com.king.springcloud.controller;

import com.king.springcloud.entities.CommonResult;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

import javax.annotation.Resource;

/**
 * @author king
 * @data 2020/7/30 23:03
 */
@Slf4j
@RestController
@RequestMapping("/consumer")
public class OrderZKController {
    // 单机
//    public static final String PAYMENT_URL = "http://127.0.0.1:8001";
    // 集群
    public static final String PAYMENT_URL = "http://cloud-payment-service";

    @Resource
    private RestTemplate restTemplate;

    @GetMapping("/payment/zk")
    public String zk(){
        return restTemplate.getForObject(PAYMENT_URL + "/payment/zk", String.class);
    }
}
